import {
  debounce as lodashDebounce,
  throttle as lodashThrottle
} from 'lodash-es';

//节流，防止用户频繁点击 默认间隔时间为1000毫秒
export const throttle = (fn: (...args: any[]) => void, wait = 1000) => {
  return lodashThrottle(fn, wait);
};
//防抖，防止用户频繁点击 默认间隔时间为1000毫秒
export const debounce = (fn: (...args: any[]) => void, wait = 1000) => {
  return lodashDebounce(fn, wait);
};
